package cn.edu.gcu.lost.sys.util;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.SimpleHash;

public class PasswordUtils {

    public static String encrypt(String plainPassword) {
        String saltSource = "adcdefg";
        String hashAlgorithmName = "MD5";
        Object salt = new Md5Hash(saltSource);
        int hashIterations = 1024;
        Object result = new SimpleHash(hashAlgorithmName, plainPassword, salt, hashIterations);
        return result.toString();
    }
}
